package combat;

/**
 * Command object used to set key bindings as given by user input.
 * 
 * @author  Casey Klimkowsky  cek3403@rit.edu
 *
 */
public class KeyBindingCommand implements Command {

	/**
	 * The player in question.
	 */
	private PlayerManager player;
	
	/**
	 * The player in question's current command array.
	 */
	private int[] pCmds = new int[5];

	
	public KeyBindingCommand( PlayerManager p ) {
		this.player = p;
		this.pCmds = p.getCommands();
		
	}
	
	@Override
	public void execute() {
		player.setCommands(pCmds);
	}
	
	/**
	 * Sets the given command to the given key binding.
	 * 
	 * @param  keyBinding  an int representing the key to set as the command
	 * @param  cmd  an int representing which command to set
	 */
	public void setKeyBinding( int[] pCommands ) {
		this.pCmds = pCommands;
	}
}